﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Equipment.Management.EquipmentInfo
{
    public class TransformStateFuncs
    {
        public static EquipmentShowState TransformString2State(string state)
        {
            switch (state)
            {
                case "Wait":
                    return EquipmentShowState.Wait;
                case "Stop":
                    return EquipmentShowState.Stop;
                case "Alarm":
                    return EquipmentShowState.Alarm;
                case "Produce":
                    return EquipmentShowState.Produce;
                case "Undefine":
                    return EquipmentShowState.Undefine;
                default:
                    return EquipmentShowState.Undefine;
            }
        }

        public static string TransformState2String(EquipmentShowState state)
        {
            switch (state)
            {
                case EquipmentShowState.Wait:
                    return "Wait";
                case EquipmentShowState.Stop:
                    return "Stop";
                case EquipmentShowState.Alarm:
                    return "Alarm";
                case EquipmentShowState.Produce:
                    return "Produce";
                case EquipmentShowState.Undefine:
                    return "Undefine";
                default:
                    return "Undefine";
            }
        }
    }
}
